﻿@inherits FeedbackComponent<Guid, bool>

<Form Loading="@_isLoading"
      Model="@_editModel"
      LabelCol="new ColLayoutParam { Span = 8 }"
      WrapperCol="new ColLayoutParam { Span = 16 }"
      OnFinish="OnFormFinish"
      Context="model">
    <FormItem Label="编号">
        <Input @bind-Value="@model.Id" Disabled />
    </FormItem>
    <FormItem Label="分组">
        <Input @bind-Value="@model.Group" />
    </FormItem>
    <FormItem Label="服务">
        <Input @bind-Value="@model.Service" />
    </FormItem>
    <FormItem Label="概要">
        <Input @bind-Value="@model.Summary" />
    </FormItem>
    <FormItem Label="地址">
        <Input @bind-Value="@model.Path" />
    </FormItem>
    <FormItem Label="请求方法">
        <SimpleSelect @bind-Value="@_currentEditModelHttpMethodType"
                      DefaultValue="@(model.Method.ToString())"
                      Style="width:120px;">
            <SelectOptions>
                @foreach (var gitem in EnumExtension.EnumToDictionary<HttpMethodType>())
                {
                    <SimpleSelectOption Value="@(gitem.Key.ToString())" Label="@(gitem.Value)"></SimpleSelectOption>
                }
            </SelectOptions>
        </SimpleSelect>
    </FormItem>
    <FormItem Label="描述">
        <TextArea AutoSize="true" MinRows="2" MaxRows="6" @bind-Value="@model.Description"></TextArea>
    </FormItem>
    <FormItem Label="启用审计">
        <Switch @bind-Value="@model.EnableAudit"></Switch>
    </FormItem>
    <FormItem Label="是否锁定">
        <Switch @bind-Value="@model.IsLocked"></Switch>
    </FormItem>
    <FormItem WrapperCol="new ColLayoutParam { Offset = 4, Span = 20 }">
        <Button Type="@ButtonType.Primary" HtmlType="submit">
            保存
        </Button>
        <Button OnClick="_=>OnFormCancel()">
            取消
        </Button>
    </FormItem>
</Form>